package com;

import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author: csh
 * @Date: 2021/7/12 16:07
 * @Description:
 */
public class TimeUtils {
    public static void main(String[] args) throws ParseException, InterruptedException {
        DateFormat df = new SimpleDateFormat("HH:mm:ss");
        Date shiftStartTime = df.parse("02:00:00");
        Date shiftEndTime = df.parse("02:04:00");

        Date exitShiftStartTime = df.parse("02:04:01");
        Date existShiftEndTime = df.parse("02:09:00");
        System.out.println(shiftStartTime.compareTo(existShiftEndTime));
        System.out.println(shiftEndTime.compareTo(exitShiftStartTime));

        System.out.println(!(shiftStartTime.compareTo(existShiftEndTime) >= 0 || shiftEndTime.compareTo(exitShiftStartTime) < 0));
        if(!(shiftStartTime.compareTo(existShiftEndTime) > 0 || shiftEndTime.compareTo(exitShiftStartTime) < 0)){
            System.out.println("进来了！");
        }

        Thread.sleep(100000);


    }
}
